package com.baida.retail.tasksystem.dao;

import com.baida.retail.tasksystem.entity.Task;
import com.baida.retail.tasksystem.enums.TaskType;

import java.util.List;

public interface TaskDao {
    int setTaskStatusToFinishedOnOrder(long orderId);

    Integer getMostUrgentTaskIdOwnedBy(int ownerId, TaskType taskType);

    List<Task> getUnassignedTasks(int repoId, TaskType taskType);

    List<Task> getTasksByOrderId(long orderId);

    Task getTaskByOrderIdAndType(Long orderId, TaskType taskType);

    List<Task> getUnfinishedTasks(int ownerId, TaskType taskType, int index, int size);

    List<Task> getFinishedTasks(int ownerId, TaskType taskType, int index, int size);

    int getUnfinishedTaskCount(int ownerId, TaskType taskType);

    int deleteByPrimaryKey(Integer id);

    int insert(Task record);

    int insertSelective(Task record);

    Task selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Task record);

    int updateByPrimaryKey(Task record);
}
